import request from "@/utils/request";

export const fetchUserList = (params) => {
  return request.get("/permission/user", { params });
};

export const fetchRoleList = () => {
  return request.get("/permission/role");
};

export const changeUserStatus = (id, status) => {
  return request.get(`/permission/user/${id}/${status}`);
};

export const addUser = (data) => {
  return request.post("/permission/user", data);
};

export const fetchUserData = (id) => {
  return request.get(`/permission/user/${id}`);
};

export const editUserData = (data) => {
  return request.put(`/permission/user/${data.id}`, data);
};

export const deleteUserData = (id) => {
  return request.delete(`permission/user/${id}`);
};
